package com.liming.common.pojo.dto.cart;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.liming.common.serializer.YuanToCentDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author liming
 * @date 2025/1/22
 */
@Data
@Schema(description = "新增购物车商品参数")
public class AddItemToCartDTO {

    @Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long productId;

    @Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer quantity;

    @Schema(description = "商品价格（以分为单位，整数型）", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonDeserialize(using = YuanToCentDeserializer.class)
    private Integer price;
}
